﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Popup_OutSourcing1.aspx.cs" Inherits="Popup_Popup_OutSourcing1" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>제목 없음</title>
    <link href="../CustomCss.css" rel="stylesheet" type="text/css" />
    <link href="../resources/css/examples.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    .my-grid .x-grid3-scroller {
        overflow : scroll;
        }
    </style>
    <script type="text/javascript">
    
       function DefaultVis(){
            document.getElementById("trMat").style.display = '';
            document.getElementById("trStd").style.display = 'none';
       }
    
       var TrVis = function(){
            if(document.getElementById("cbxGubun").value.trim() == "주요자재현황"){
                document.getElementById("trMat").style.display = '';
                document.getElementById("trStd").style.display = 'none';
            }
            else{
                document.getElementById("trMat").style.display = 'none';
                document.getElementById("trStd").style.display = '';
            }
       }
       
       var CreateRow = function(){
            var arr = document.getElementById("hdRowValue").value.split('|');
            alert(arr[0] + "    " + arr[1] + "    " + "    " + arr[2] + "    " + "    " + arr[3] + "    " + "    " + arr[4] + "    " + "    " + arr[5] + "    " + "    " + arr[6] + "    " + "    " + arr[7] + "    " + "    " + arr[8] + "    " + "    " + arr[9] + "    " + "    " + arr[10]);
            parent.SelectAddOutSourcing(document.getElementById("hdRowValue").value, "1");
            parent.Ext.getCmp('Window1').hide();
       }
              
    </script>
</head>
<body onload="DefaultVis();">
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Store ID="StrBiz" runat="server">
        <Reader>
            <ext:JsonReader IDProperty="BIZ_REGNO">
                <Fields>
                    <ext:RecordField Name="BIZ_REGNO" />
                    <ext:RecordField Name="COMP_NM" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store ID="StrMKClass" runat="server">
        <Reader>
            <ext:JsonReader IDProperty="MK_CLASS">
                <Fields>
                    <ext:RecordField Name="MK_CLASS" />
                    <ext:RecordField Name="NAME" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store ID="StrClass" runat="server">
        <Reader>
            <ext:JsonReader IDProperty="CLASS">
                <Fields>
                    <ext:RecordField Name="CLASS" />
                    <ext:RecordField Name="NAME" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Panel ID="Panel1" runat="server" Title="" AnchorVertical="15%">
        <Content>
            <table style="width: 70%;">
                <tr>
                    <td colspan="8">
                        <table style="width: 100%;">
                            <tr>
                                <td>조회구분 : </td>
                                <td>
                                    <ext:ComboBox ID="cbxGubun" runat="server" Mode="Local" Editable="false" SelectOnFocus="true">
                                        <Listeners>
                                            <Select Fn="TrVis" />
                                        </Listeners>
                                        <DirectEvents>
                                            <Select OnEvent="ChangeGubun"></Select>
                                        </DirectEvents>
                                    </ext:ComboBox>
                                </td>
                                <td>
                                    <ext:Button ID="btnSearch" runat="server" Text="조회" Icon="Zoom">
                                        <DirectEvents>
                                            <Click OnEvent="PopListSearch">
                                                <EventMask ShowMask="true" Msg="조회중입니다..." MinDelay="50" />
                                            </Click>
                                        </DirectEvents>
                                    </ext:Button>
                                </td>
                                <td>
                                    <ext:Button ID="btnAdd" runat="server" Text="등록" Icon="Add">
                                        <Listeners>
                                            <Click Fn="CreateRow" />
                                        </Listeners>
                                    </ext:Button>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server" id="trMat">
                    <td>거래처 : </td>
                    <td>
                        <ext:ComboBox ID="cbxCustomer" runat="server" StoreID="StrBiz" DisplayField="COMP_NM" ValueField="BIZ_REGNO" Mode="Local" />
                    </td>
                    <td>자재명 : </td>
                    <td>
                        <ext:TextField ID="tbxMat" runat="server"></ext:TextField>
                    </td>
                    <td>
                        <ext:TextField ID="tbxSpec" runat="server"></ext:TextField>
                    </td>
                    <td colspan="3">&nbsp;</td>
                </tr>
                <tr runat="server" id="trStd">
                    <td>대분류 : </td>
                    <td>
                        <ext:ComboBox ID="cbxMkClass" runat="server" StoreID="StrMKClass" DisplayField="NAME" ValueField="MK_CLASS" Mode="Local" />
                    </td>
                    <td>소분류 : </td>
                    <td>
                        <ext:ComboBox ID="cbxClass" runat="server" StoreID="StrClass" DisplayField="NAME" ValueField="CLASS" Mode="Local" />
                    </td>
                    <td>자재명 : </td>
                    <td>
                        <ext:TextField ID="tbxMat2" runat="server"></ext:TextField>
                    </td>
                    <td>규격 : </td>
                    <td>
                        <ext:TextField ID="tbxSpec2" runat="server"></ext:TextField>
                    </td>
                </tr>
            </table>
        </Content>
    </ext:Panel>
    <ext:Panel>
    <Items>
    <ext:GridPanel ID="GridPanel1" runat="server" AutoScroll="true" Cls="my-grid" Height="250">
        <Store>
            <ext:Store ID="Store1" runat="server">
                <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="PROJ_CD" />
                            <ext:RecordField Name="DT" />
                            <ext:RecordField Name="SEQ_NO" />
                            <ext:RecordField Name="ITEM_CD" />
                            <ext:RecordField Name="SUB_ITEM_CD" />
                            <ext:RecordField Name="ITEM_CD_NM" />
                            <ext:RecordField Name="SUB_ITEM_NM" />
                            <ext:RecordField Name="SPEC" />
                            <ext:RecordField Name="UNIT" />
                            <ext:RecordField Name="QTY" />
                            <ext:RecordField Name="UC" />
                            <ext:RecordField Name="AMT" />
                            <ext:RecordField Name="P_QTY" />
                            <ext:RecordField Name="P_AMT" />
                            <ext:RecordField Name="S_QTY" />
                            <ext:RecordField Name="S_AMT" />
                            <ext:RecordField Name="A_QTY" />
                            <ext:RecordField Name="REMARK" />
                            <ext:RecordField Name="VAT_CHK" />
                            <ext:RecordField Name="PROOF" />
                            <ext:RecordField Name="BIZ_REGNO" />
                            <ext:RecordField Name="ATTACH" />
                            <ext:RecordField Name="ITEM_GUBUN" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
                <Listeners>
                    <LoadException Handler="var e = e || {메시지: response.responseText}; alert('로드하지 못했습니다.: ' + e.message);" />
                </Listeners>
            </ext:Store>
        </Store>
        <View>
            <ext:GridView ID="GridView1" runat="server"/>
        </View>
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:RowNumbererColumn />
                <ext:Column ColumnID="BIZ_REGNO" Header="업체코드" Width="120" DataIndex="BIZ_REGNO" Hidden="true" />
                <ext:Column ColumnID="SUB_ITEM_CD" Header="서브아이템코드" Width="100" DataIndex="SUB_ITEM_CD" Align="Center" Hidden="true"  />
                <ext:Column ColumnID="SUB_ITEM_NM" Header="자재명" Width="120" DataIndex="SUB_ITEM_NM" />
                <ext:Column ColumnID="UC" Header="단가" Width="100" DataIndex="UC" Align="Center" />
                <ext:Column ColumnID="SPEC" Header="규격" Width="120" DataIndex="SPEC" />
                <ext:Column ColumnID="ITEM_GUBUN" Header="수목/자재" Width="100" DataIndex="ITEM_GUBUN" Align="Center" />
                <ext:Column ColumnID="UNIT" Header="단위" Width="250" DataIndex="UNIT" />
                <ext:Column ColumnID="QTY" Header="계약수량" Width="100" DataIndex="QTY" Align="Center" />
                <ext:Column ColumnID="P_QTY" Header="계획수량" Width="120" DataIndex="P_QTY" Align="Center" />
                <ext:Column ColumnID="S_QTY" Header="금일수량" Width="100" DataIndex="S_QTY" />
                <ext:Column ColumnID="REMARK" Header="비고" Width="150" DataIndex="REMARK" Align="Center" />
                <ext:Column ColumnID="PROJ_CD" Header="프로젝트코드" Width="60" DataIndex="PROJ_CD" Hidden="true" />
                <ext:Column ColumnID="DT" Header="날짜" Width="100" DataIndex="DT" Hidden="true" />
                <ext:Column ColumnID="SEQ_NO" Header="SEQ" Width="150" DataIndex="SEQ_NO" Hidden="true" />
                <ext:Column ColumnID="AMT" Header="계약수량*단가" Width="100" DataIndex="AMT" Align="Center" Hidden="true" />
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                <DirectEvents>
                    <RowSelect OnEvent="CreateParameter">
                        <ExtraParams>
                            <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly:true}))" Mode="Raw" />
                        </ExtraParams>
                    </RowSelect>
                </DirectEvents>
            </ext:RowSelectionModel>
        </SelectionModel>
    </ext:GridPanel>
    </Items>
    </ext:Panel>
    <ext:GridPanel ID="GridPanel2" runat="server" AutoScroll="true" Cls="my-grid" Height="350">
        <Store>
            <ext:Store ID="Store2" runat="server">
                <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="PROJ_CD" />
                            <ext:RecordField Name="DT" />
                            <ext:RecordField Name="SEQ_NO" />
                            <ext:RecordField Name="NAME" />
                            <ext:RecordField Name="ID" />
                            <ext:RecordField Name="GUBUN" />
                            <ext:RecordField Name="ACCUM" />
                            <ext:RecordField Name="JEN_CNT" />
                            <ext:RecordField Name="INPUT" />
                            <ext:RecordField Name="TOT_CNT" />
                            <ext:RecordField Name="PAY" />
                            <ext:RecordField Name="TOT" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
                <Listeners>
                    <LoadException Handler="var e = e || {메시지: response.responseText}; alert('로드하지 못했습니다.: ' + e.message);" />
                </Listeners>
            </ext:Store>
        </Store>
        <View>
            <ext:GridView ID="GridView2" runat="server"/>
        </View>
        <ColumnModel ID="ColumnModel2" runat="server">
            <Columns>
                <ext:RowNumbererColumn />
                <ext:Column ColumnID="PROJ_CD" Header="코드" Width="60" DataIndex="PROJ_CD" />
                <ext:Column ColumnID="DT" Header="이름" Width="100" DataIndex="DT" />
                <ext:Column ColumnID="SEQ_NO" Header="주민번호" Width="150" DataIndex="SEQ_NO" />
                <ext:Column ColumnID="GUBUN" Header="팀" Width="250" DataIndex="GUBUN" Align="Center" />
                <ext:Column ColumnID="ACCUM" Header="업무내용" Width="100" DataIndex="ACCUM" Align="Center" />
                <ext:Column ColumnID="ID" Header="일급" Width="100" DataIndex="ID" Align="Center" />
                <ext:Column ColumnID="PROJ_CD" Header="입사일" Width="120" DataIndex="PROJ_CD" />
                <ext:Column ColumnID="DT" Header="퇴직일" Width="120" DataIndex="DT" />
                <ext:Column ColumnID="SEQ_NO" Header="주소" Width="250" DataIndex="SEQ_NO" />
                <ext:Column ColumnID="GUBUN" Header="전화번호" Width="100" DataIndex="GUBUN" Align="Center" />
                <ext:Column ColumnID="ACCUM" Header="이동전화" Width="100" DataIndex="ACCUM" Align="Center" />
                <ext:Column ColumnID="ID" Header="은행" Width="100" DataIndex="ID" Align="Center" />
                <ext:Column ColumnID="ID" Header="계좌번호" Width="120" DataIndex="ID" Align="Center" />
            </Columns>
        </ColumnModel>
        <TopBar>
            <ext:Toolbar ID="Toolbar2" runat="server">
                <Items>
                    <ext:Label ID="Label2" runat="server" Text="일용직 사원 등록">
                    </ext:Label>
                    <ext:ToolbarFill ID="ToolbarFill2" runat="server" />
                </Items>
            </ext:Toolbar>
        </TopBar>
        <SelectionModel>
            <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" SingleSelect="true">
                <DirectEvents>
                    <RowSelect OnEvent="CreateParameter">
                        <ExtraParams>
                            <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel1}.getRowValues({selectedOnly:true}))" Mode="Raw" />
                        </ExtraParams>
                    </RowSelect>
                </DirectEvents>
            </ext:RowSelectionModel>
        </SelectionModel>
    </ext:GridPanel>
        
    <ext:Hidden ID="hdRowValue" runat="server" />
    </form>
</body>
</html>
